{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport Trigger from 'rc-trigger';\nimport classNames from 'classnames';\nimport raf from \"rc-util/es/raf\";\nimport { MenuContext } from \"../context/MenuContext\";\nimport { placements, placementsRtl } from \"../placements\";\nimport { getMotion } from \"../utils/motionUtil\";\nvar popupPlacementMap = {\n  horizontal: 'bottomLeft',\n  vertical: 'rightTop',\n  'vertical-left': 'rightTop',\n  'vertical-right': 'leftTop'\n};\nexport default function PopupTrigger(_ref) {\n  var prefixCls = _ref.prefixCls,\n    visible = _ref.visible,\n    children = _ref.children,\n    popup = _ref.popup,\n    popupClassName = _ref.popupClassName,\n    popupOffset = _ref.popupOffset,\n    disabled = _ref.disabled,\n    mode = _ref.mode,\n    onVisibleChange = _ref.onVisibleChange;\n  var _React$useContext = React.useContext(MenuContext),\n    getPopupContainer = _React$useContext.getPopupContainer,\n    rtl = _React$useContext.rtl,\n    subMenuOpenDelay = _React$useContext.subMenuOpenDelay,\n    subMenuCloseDelay = _React$useContext.subMenuCloseDelay,\n    builtinPlacements = _React$useContext.builtinPlacements,\n    triggerSubMenuAction = _React$useContext.triggerSubMenuAction,\n    forceSubMenuRender = _React$useContext.forceSubMenuRender,\n    rootClassName = _React$useContext.rootClassName,\n    motion = _React$useContext.motion,\n    defaultMotions = _React$useContext.defaultMotions;\n  var _React$useState = React.useState(false),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    innerVisible = _React$useState2[0],\n    setInnerVisible = _React$useState2[1];\n  var placement = rtl ? _objectSpread(_objectSpread({}, placementsRtl), builtinPlacements) : _objectSpread(_objectSpread({}, placements), builtinPlacements);\n  var popupPlacement = popupPlacementMap[mode];\n  var targetMotion = getMotion(mode, motion, defaultMotions);\n  var mergedMotion = _objectSpread(_objectSpread({}, targetMotion), {}, {\n    leavedClassName: \"\".concat(prefixCls, \"-hidden\"),\n    removeOnLeave: false,\n    motionAppear: true\n  }); // Delay to change visible\n\n  var visibleRef = React.useRef();\n  React.useEffect(function () {\n    visibleRef.current = raf(function () {\n      setInnerVisible(visible);\n    });\n    return function () {\n      raf.cancel(visibleRef.current);\n    };\n  }, [visible]);\n  return /*#__PURE__*/React.createElement(Trigger, {\n    prefixCls: prefixCls,\n    popupClassName: classNames(\"\".concat(prefixCls, \"-popup\"), _defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), rtl), popupClassName, rootClassName),\n    stretch: mode === 'horizontal' ? 'minWidth' : null,\n    getPopupContainer: getPopupContainer,\n    builtinPlacements: placement,\n    popupPlacement: popupPlacement,\n    popupVisible: innerVisible,\n    popup: popup,\n    popupAlign: popupOffset && {\n      offset: popupOffset\n    },\n    action: disabled ? [] : [triggerSubMenuAction],\n    mouseEnterDelay: subMenuOpenDelay,\n    mouseLeaveDelay: subMenuCloseDelay,\n    onPopupVisibleChange: onVisibleChange,\n    forceRender: forceSubMenuRender,\n    popupMotion: mergedMotion\n  }, children);\n}","map":{"version":3,"names":["_defineProperty","_objectSpread","_slicedToArray","React","Trigger","classNames","raf","MenuContext","placements","placementsRtl","getMotion","popupPlacementMap","horizontal","vertical","PopupTrigger","_ref","prefixCls","visible","children","popup","popupClassName","popupOffset","disabled","mode","onVisibleChange","_React$useContext","useContext","getPopupContainer","rtl","subMenuOpenDelay","subMenuCloseDelay","builtinPlacements","triggerSubMenuAction","forceSubMenuRender","rootClassName","motion","defaultMotions","_React$useState","useState","_React$useState2","innerVisible","setInnerVisible","placement","popupPlacement","targetMotion","mergedMotion","leavedClassName","concat","removeOnLeave","motionAppear","visibleRef","useRef","useEffect","current","cancel","createElement","stretch","popupVisible","popupAlign","offset","action","mouseEnterDelay","mouseLeaveDelay","onPopupVisibleChange","forceRender","popupMotion"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/rc-menu/es/SubMenu/PopupTrigger.js"],"sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport Trigger from 'rc-trigger';\nimport classNames from 'classnames';\nimport raf from \"rc-util/es/raf\";\nimport { MenuContext } from \"../context/MenuContext\";\nimport { placements, placementsRtl } from \"../placements\";\nimport { getMotion } from \"../utils/motionUtil\";\nvar popupPlacementMap = {\n  horizontal: 'bottomLeft',\n  vertical: 'rightTop',\n  'vertical-left': 'rightTop',\n  'vertical-right': 'leftTop'\n};\nexport default function PopupTrigger(_ref) {\n  var prefixCls = _ref.prefixCls,\n      visible = _ref.visible,\n      children = _ref.children,\n      popup = _ref.popup,\n      popupClassName = _ref.popupClassName,\n      popupOffset = _ref.popupOffset,\n      disabled = _ref.disabled,\n      mode = _ref.mode,\n      onVisibleChange = _ref.onVisibleChange;\n\n  var _React$useContext = React.useContext(MenuContext),\n      getPopupContainer = _React$useContext.getPopupContainer,\n      rtl = _React$useContext.rtl,\n      subMenuOpenDelay = _React$useContext.subMenuOpenDelay,\n      subMenuCloseDelay = _React$useContext.subMenuCloseDelay,\n      builtinPlacements = _React$useContext.builtinPlacements,\n      triggerSubMenuAction = _React$useContext.triggerSubMenuAction,\n      forceSubMenuRender = _React$useContext.forceSubMenuRender,\n      rootClassName = _React$useContext.rootClassName,\n      motion = _React$useContext.motion,\n      defaultMotions = _React$useContext.defaultMotions;\n\n  var _React$useState = React.useState(false),\n      _React$useState2 = _slicedToArray(_React$useState, 2),\n      innerVisible = _React$useState2[0],\n      setInnerVisible = _React$useState2[1];\n\n  var placement = rtl ? _objectSpread(_objectSpread({}, placementsRtl), builtinPlacements) : _objectSpread(_objectSpread({}, placements), builtinPlacements);\n  var popupPlacement = popupPlacementMap[mode];\n  var targetMotion = getMotion(mode, motion, defaultMotions);\n\n  var mergedMotion = _objectSpread(_objectSpread({}, targetMotion), {}, {\n    leavedClassName: \"\".concat(prefixCls, \"-hidden\"),\n    removeOnLeave: false,\n    motionAppear: true\n  }); // Delay to change visible\n\n\n  var visibleRef = React.useRef();\n  React.useEffect(function () {\n    visibleRef.current = raf(function () {\n      setInnerVisible(visible);\n    });\n    return function () {\n      raf.cancel(visibleRef.current);\n    };\n  }, [visible]);\n  return /*#__PURE__*/React.createElement(Trigger, {\n    prefixCls: prefixCls,\n    popupClassName: classNames(\"\".concat(prefixCls, \"-popup\"), _defineProperty({}, \"\".concat(prefixCls, \"-rtl\"), rtl), popupClassName, rootClassName),\n    stretch: mode === 'horizontal' ? 'minWidth' : null,\n    getPopupContainer: getPopupContainer,\n    builtinPlacements: placement,\n    popupPlacement: popupPlacement,\n    popupVisible: innerVisible,\n    popup: popup,\n    popupAlign: popupOffset && {\n      offset: popupOffset\n    },\n    action: disabled ? [] : [triggerSubMenuAction],\n    mouseEnterDelay: subMenuOpenDelay,\n    mouseLeaveDelay: subMenuCloseDelay,\n    onPopupVisibleChange: onVisibleChange,\n    forceRender: forceSubMenuRender,\n    popupMotion: mergedMotion\n  }, children);\n}"],"mappings":"AAAA,OAAOA,eAAe,MAAM,2CAA2C;AACvE,OAAOC,aAAa,MAAM,0CAA0C;AACpE,OAAOC,cAAc,MAAM,0CAA0C;AACrE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,UAAU,EAAEC,aAAa,QAAQ,eAAe;AACzD,SAASC,SAAS,QAAQ,qBAAqB;AAC/C,IAAIC,iBAAiB,GAAG;EACtBC,UAAU,EAAE,YAAY;EACxBC,QAAQ,EAAE,UAAU;EACpB,eAAe,EAAE,UAAU;EAC3B,gBAAgB,EAAE;AACpB,CAAC;AACD,eAAe,SAASC,YAAY,CAACC,IAAI,EAAE;EACzC,I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